package com.yc.boot.train.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.boot.train.model.find.GradeFeedBack;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Create with IntelliT IDEA
 *
 * @Author: zhengmingzhe
 * @Date: 2022/01/06/17:13
 * @Description:
 */
@Mapper
public interface GradeFeedbackMapper extends BaseMapper<GradeFeedBack> {
//    查询分数回馈界面
    @Select("select g.id as keyId,t.course_name as courseName ,u.user_name as teacherName, t.course_time as courseTime,g.course_grade as courseGrade," +
            "g.teacher_comment as teacherComment, g.student_feedback as studentFeedback,t.train_form as trainForm," +
            "case when g.course_grade >= 60 then '合格' else '不合格' end as isQualified from train_course as t " +
            "left join grade_comment_feedback as g on t.id=g.course_id " +
            "left join sys_user as u on g.teacher_id=u.id ${ew.customSqlSegment}")
    IPage<GradeFeedBack> queryGradeFeedback(Page<GradeFeedBack> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<GradeFeedBack> wrapper);
}
